package com.bluesky.controller;

import com.bluesky.comm.Result;
import com.bluesky.comm.ResultUtils;
import com.bluesky.dto.lesson032.CreateOrderRequest;
import com.bluesky.service.lesson032.ILesson032OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/lesson032")
@Slf4j
public class Lesson032Controller {

    @Autowired
    private ILesson032OrderService lesson032OrderService;


    @PostMapping("/createOrder")
    public Result<String> createOrder(@Validated @RequestBody CreateOrderRequest req) {
        return ResultUtils.success(this.lesson032OrderService.createOrder(req));
    }
}
